<template>
	<div>
		<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newList" :key="item.id">
					<router-link :to="'/home/newDetail/' + item.id ">
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							{{ item.title }}
							<div class="headNew">
							<p class="mui-ellipsis">{{ item.zhaiyao }}</p>
							<p class="mui-ellipsis">{{ item.click }}</p>
							</div>
							<p>{{ item.add_time | dateFormat() }}</p>
						</div>
					</router-link>
				</li>
			</ul>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui'

	export default {
		data () {
			return {
				newList:[]
			}
		},
		created () {
			this.getNewList()
		},
		methods: {
			getNewList () {
				this.$http.get("http://www.liulongbin.top:3005/api/getnewsList").then(result => {
					if (result.body.status === 0) {
						console.log(result)
						this.newList = result.body.message
					} else {
						Toast('数据出错')
					}
				})
			}
		}
	}

</script>

<style>
	
.headNew{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
}
</style>